from pyted import *
from benchmarks.tacomark import TacoBenchmark
import os

def test_benchmark_user_optimizer(ckt_id):
    from demo_boes import BOES_Demo

    tech = get_pdk().name
    dir_name = "ID_" + ckt_id + "_Tech_" + tech
    if not os.path.exists(dir_name):
        os.mkdir(dir_name)
        os.chdir(dir_name)
        # configs = {"pop_size": 10, "maxiters": 10, "ref_point": 6}
        # configs = {"pop_size": 20, "maxiters": 40}
        configs = {"maxiters": 100, "seed": 10}
        TacoBenchmark().run_new_optimizer(BOES_Demo, ckt_id=int(ckt_id), fig_path="tracer.png", **configs)
    else:
        print(dir_name + " exists, please check and remove it in advance!")
